﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net;
using System.IO;
//COMPARACION DE REST SOAP
//REST CON COLAS(MENSAJERIA)
//PATRONES
namespace TestReniecService
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {

            HttpWebRequest req = WebRequest.Create(
             "http://localhost:5737/Reniec.svc/buscarPersonaXDNI?DNI=44105001") as HttpWebRequest;

            HttpWebResponse res = req.GetResponse() as HttpWebResponse;
            StreamReader reader = new StreamReader(res.GetResponseStream());
            string NombreEmpleado = reader.ReadToEnd();
            //int hora = DateTime.Now.Hour;

            Assert.AreEqual(NombreEmpleado, "\"CALDERON SULCA CARLOS\"");

            //if (hora < 12)
            //    Assert.AreEqual(saludo, "\"Buenos Dias\"");
            //else if (hora < 19)
            //    Assert.AreEqual(saludo, "\"Buenas Tardes\"");
            //else
            //    Assert.AreEqual(saludo, "\"Buenos Noches\"");
        }
    }
}
